import sys
from tkinter import *

# Note that here the function is defined above its call
def cmdHello():
    print("Hello there")
    label1 = Label(mainWindow, text="hello there, i care").pack()

mainWindow = Tk()
mainWindow.geometry("300x100+200+200")
mainWindow.title("Buttons")

label1 = Label(mainWindow, text="this is label 1").pack()
cmdHello = Button(mainWindow, text="Button1", command=cmdHello, fg="red", bg="blue").pack()
cmdHello = Button(mainWindow, text="Button2", command=cmdHello).pack()

mainWindow.mainloop()